package com.dk.logc.business;

import com.dk.logc.domain.CountRole;
import com.dk.logc.domain.FlogOnline;
import com.dk.logc.service.CountRoleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author 林道敬
 * @Date 2024-01-11
 * @Description
 **/
@Component
@Slf4j
public class FlogOnlineBusiness{
    @Autowired
    private CountRoleService countRoleService;

    public void online(FlogOnline flogOnline, CountRole countRole){
        countRole.setOnlineNum((int) (countRole.getOnlineNum()+flogOnline.getNum()));
        countRoleService.saveOrUpdate(countRole);
    }
}
